﻿<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>.NET快速信息化系统开发框架</title>
    <link href="/Themes/Styles/accordion.css" rel="stylesheet" />
    <script src="/Themes/Scripts/jquery-1.8.2.min.js"></script>
    <link href="/Themes/Scripts/artDialog/skins/blue.css" rel="stylesheet" type="text/css" />
    <script src="/Themes/Scripts/artDialog/artDialog.source.js" type="text/javascript"></script>
    <script src="/Themes/Scripts/artDialog/iframeTools.source.js" type="text/javascript"></script>
    <script src="/Themes/Scripts/FunctionJS.js"></script>
    <script src="MainIndex.js"></script>
    <script>
        /**初始化**/
        $(document).ready(function () {
            document.onselectstart = function () { return false; }
            $(document).bind("contextmenu", function () {
                return false;
            });
            Loading(true);
            iframeresize();
            AddTabMenu('Imain', '/Frame/HomeIndex', '首页主控台', '4963_home.png', 'false');
            GetAccordionMenu();
            writeDateInfo();
            readyIndex();
            resizeLayout();
            $("#tabs_Imain").hover(function () {
                AddTabMenu('Imain', '/Frame/HomeIndex', '首页主控台', '4963_home.png', 'false');
            });
        });
        function resizeLayout() {
            resizeU();
            $(window).resize(resizeU);
            function resizeU() {
                var accordion_head = $('.accordion > li > a'),
                accordion_body = $('.accordion li > .sub-menu');
                $(".sub-menu").css('height', $(".navigation").height() - 19 - accordion_head.length * accordion_head.height() - accordion_head.length + 'px');
                accordion_head.first().addClass('active').next().slideDown('normal');
                accordion_head.on('click', function (event) {
                    event.preventDefault();
                    accordion_body.slideUp('normal');
                    $(this).next().stop(true, true).slideToggle('normal');
                    accordion_head.removeClass('active');
                    $(this).addClass('active');
                });
            }
        }
        //手风琴导航菜单
        var AccordionMenuJson = "";
        function GetAccordionMenu() {
            var index = 0;
            var html = "";
            getAjax("/Frame/LoadMenu", "", function (data) {
                AccordionMenuJson = eval("(" + data + ")");
                $.each(AccordionMenuJson, function (i) {
                    if (AccordionMenuJson[i].ParentId == '9f8ce93a-fc2d-4914-a59c-a6b49494108f') {
                        if (index == 0) {
                            html += "<li><a style=\"border-top: 0px solid #ccc;\"><img src=\"/Themes/Images/32/" + AccordionMenuJson[i].Img + "\">" + AccordionMenuJson[i].FullName + "</a>";
                        } else {
                            html += "<li><a><img src=\"/Themes/Images/32/" + AccordionMenuJson[i].Img + "\">" + AccordionMenuJson[i].FullName + "</a>";
                        }
                        html += GetSubmenu(AccordionMenuJson[i].MenuId);
                        html += "</li>";
                        index++;
                    }
                });
            })
            $(".accordion").append(html);
        }
        //子菜单
        function GetSubmenu(MenuId) {
            var html = "";
            html += "<div class=\"sub-menu\">";
            $.each(AccordionMenuJson, function (i) {
                if (AccordionMenuJson[i].ParentId == MenuId) {
                    html += "<div onclick=\"AddTabMenu('" + AccordionMenuJson[i].MenuId + "', '" + AccordionMenuJson[i].NavigateUrl + "', '" + AccordionMenuJson[i].FullName + "', '" + AccordionMenuJson[i].Img + "', 'true');\" ><img src=\"/Themes/Images/32/" + AccordionMenuJson[i].Img + "\">" + AccordionMenuJson[i].FullName + "</div>";
                }
            });
            html += "</div>";
            return html;
        }
        //控制面板
        function Controlpanel() {
            AddTabMenu('Controlpanel', '/Controlpanel/ControlpanelIndex', '控制面板', '5026_settings.png', 'true');
        }
        //样式
        function readyIndex() {
            $("#toolbar img").hover(function () {
                $(this).addClass("pageBase_Div");
            }, function () {
                $(this).removeClass("pageBase_Div");
            });
            $("#topnav li").click(function () {
                $("#topnav li").find('a').removeClass("onnav")
                $(this).find('a').addClass("onnav");
            });
            $(".sub-menu div").click(function () {
                $('.sub-menu div').removeClass("selected")
                $(this).addClass("selected");
            }).hover(function () {
                $(this).addClass("navHover");
            }, function () {
                $(this).removeClass("navHover");
            });
            $(".sub-menu").hover(function () {
                $(this).css("overflow", "auto");
            }, function () {
                $(this).css("overflow", "hidden");
            });
        }
        /**自应高度**/
        var MainContent_subtract = 122;
        var Sidebar_subtract = 148;
        function iframeresize() {
            resizeU();
            $(window).resize(resizeU);
            function resizeU() {
                var divkuangH = $(window).height();
                $("#MainContent").height(divkuangH - MainContent_subtract - 1);
            }
        }
        /**安全退出**/
        function IndexOut() {
            top.showConfirmMsg('亲：您是否确认退出通用基本权限系统？', function (r) {
                if (r) {
                    getAjax("/Frame/OutLogin", "", function (data) {
                        window.location.href = '/Frame/Login';
                    })
                }
            });
        }
        //当前日期
        function writeDateInfo() {
            var now = new Date();
            var year = now.getFullYear(); //getFullYear getYear
            var month = now.getMonth();
            var date = now.getDate();
            var day = now.getDay();
            var hour = now.getHours();
            var minu = now.getMinutes();
            var sec = now.getSeconds();
            var week;
            month = month + 1;
            if (month < 10) month = "0" + month;
            if (date < 10) date = "0" + date;
            if (hour < 10) hour = "0" + hour;
            if (minu < 10) minu = "0" + minu;
            if (sec < 10) sec = "0" + sec;
            var arr_week = new Array("星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六");
            week = arr_week[day];
            var time = "";
            time = year + "年" + month + "月" + date + "日" + " " + hour + ":" + minu + ":" + sec;

            $("#datetime").text(time);
            var timer = setTimeout("writeDateInfo()", 1000);
        }
        var Contentheight = "";
        var Contentwidth = "";
        var FixedTableHeight = "";
        //最大化
        function Maximize() {
            $("#Header").hide();
            $("#full_screen").attr('src', '/Themes/Images/16/arrow_inout.gif').attr('title', '还原').attr('onclick', 'Fullrestore()');
            MainContent_subtract = MainContent_subtract - 70;
            Sidebar_subtract = Sidebar_subtract - 70;
            iframeresize();
        }
        //还原
        function Fullrestore() {
            $("#Header").show();
            $("#full_screen").attr('src', '/Themes/Images/16/arrow_out.gif').attr('title', '最大化').attr('onclick', 'Maximize()');
            MainContent_subtract = MainContent_subtract + 70;
            Sidebar_subtract = Sidebar_subtract + 70;
            iframeresize();
        }
        //=================动态菜单tab标签========================
        function AddTabMenu(tabid, url, name, img, Isclose, IsReplace) {
            SetSystemId(tabid);
            if (url == "" || url == "#") {
                url = "/ErrorPage/404.aspx";
            }
            var tabs_container = top.$("#tabs_container");
            var ContentPannel = top.$("#ContentPannel");
            if (IsReplace == 'true') {
                top.RemoveDiv(tabid);
            }
            if (Isclose != 'false') { //判断是否带关闭tab
                top.$(".navigation").hide();
            } else {
                top.$(".navigation").show();
            }
            if (top.document.getElementById("tabs_" + tabid) == null) { //如果当前tabid存在直接显示已经打开的tab
                if (tabs_container.find('li').length > 5) {
                    showFaceMsg("为保证系统效率,只允许同时运行6个功能窗口,请关闭一些窗口后重试！");
                    top.$(".navigation").show();
                    return false;
                }
                Loading(true);
                tabs_container.find('li').removeClass('selected');
                ContentPannel.find('iframe').hide();
                if (Isclose != 'false') { //判断是否带关闭tab
                    tabs_container.append("<li id=\"tabs_" + tabid + "\" class='selected' win_close='true'><span title='" + name + "' onclick=\"javascript:AddTabMenu('" + tabid + "','" + url + "','" + name + "','" + img + "','true')\"><a href=\"javascript:;\"><img src=\"/Themes/Images/32/" + img + "\" width=\"20\" height=\"20\">" + name + "</a></span><a class=\"win_close\" title=\"关闭当前窗口\" onclick=\"RemoveDiv('" + tabid + "')\"></a></li>");
                } else {
                    tabs_container.append("<li id=\"tabs_" + tabid + "\" class=\"selected\" onclick=\"javascript:AddTabMenu('" + tabid + "','" + url + "','" + name + "','" + img + "','false')\"><a><img src=\"/Themes/Images/32/" + img + "\" width=\"20\" height=\"20\">" + name + "</a></li>");
                }
                ContentPannel.append("<iframe id=\"tabs_iframe_" + tabid + "\" name=\"tabs_iframe_" + tabid + "\" height=\"100%\" width=\"100%\" src=\"" + url + "\" frameBorder=\"0\"></iframe>");
            }
            else {
                tabs_container.find('li').removeClass('selected');
                ContentPannel.find('iframe').hide();
                tabs_container.find('#tabs_' + tabid).addClass('selected');
                top.document.getElementById("tabs_iframe_" + tabid).style.display = 'block';
            }
        }
        //关闭当前tab
        function ThisCloseTab() {
            var tabs_container = top.$("#tabs_container");
            top.RemoveDiv(tabs_container.find('.selected').attr('id').substr(5));
        }
        //关闭事件
        function RemoveDiv(obj) {
            var tabs_container = top.$("#tabs_container");
            var ContentPannel = top.$("#ContentPannel");
            tabs_container.find("#tabs_" + obj).remove();
            ContentPannel.find("#tabs_iframe_" + obj).remove();
            var tablist = tabs_container.find('li');
            var pannellist = ContentPannel.find('iframe');
            if (tablist.length > 0) {
                tablist[tablist.length - 1].className = 'selected';
                pannellist[tablist.length - 1].style.display = 'block';
            }
            if (tablist.length == '1') {
                top.$(".navigation").show();
            }
        }
        //设置模块ID存储 Session，用来显示按钮
        function SetSystemId(MenuId) {
            getAjax("/Frame/SetSystemId", "SystemId=" + MenuId, function (data) {
            })
        }
    </script>
</head>
<body>
    <form id="form1">
        <div id="Container">
            <div id="Header">
                <div id="HeaderLogo">
                    <img src="../Themes/Images/product.png" style="" />
                </div>
                <div id="Headermenu">
                    <ul id="topnav">
                        <li id="metnav_1" class="list">
                            <a href="javascript:;" id="nav_1" class="onnav" onclick="Replace();">
                                <span class="c1"></span>
                                首页信息
                            </a>
                        </li>
                        <li id="metnav_3" class="list" onclick="Controlpanel();">
                            <a href="javascript:;" id="nav_3">
                                <span class="c3"></span>
                                控制面板
                            </a>
                        </li>
                        <li id="metnav_5" class="list" onclick="IndexOut();">
                            <a href="javascript:;" id="nav_4">
                                <span class="c4"></span>
                                安全退出
                            </a>
                        </li>
                    </ul>
                </div>
            </div>
            <div id="Headerbotton">
                <div id="left_title">
                    <img src="/Themes/Images/32/clock_32.png" alt="" width="20" height="20" style="vertical-align: middle; padding-bottom: 3px;" />
                    <span id="datetime">1900年01月01日 00:00:00</span>
                </div>
                <div id="dww-menu" class="mod-tab">
                    <div class="mod-hd" style="float: left">
                        <ul class="tab-nav" id="tabs_container">
                        </ul>
                    </div>
                    <div id="toolbar" style="float: right; width: 75px; padding-right: 5px; text-align: right;">
                        <img src="/Themes/Images/16/arrow_refresh.png" title="刷新当前窗口" alt="" onclick="Loading(true);top.$('#' + Current_iframeID())[0].contentWindow.window.location.reload();return false;"
                            width="16" height="16" style="padding-bottom: 3px; cursor: pointer; vertical-align: middle;" />
                        &nbsp;
                        <img id="full_screen" src="/Themes/Images/16/arrow_out.gif" title="最大化" alt="" onclick="Maximize();"
                            width="16" height="16" style="padding-bottom: 3px; cursor: pointer; vertical-align: middle;" />
                        &nbsp;
                    </div>
                </div>
            </div>
            <div id="MainContent">
                <div class="navigation">
                    <ul class="accordion">
                    </ul>
                </div>
                <div id="ContentPannel">
                </div>
            </div>
            <div id="botton_toolbar">
                <div style="width: 42%; text-align: left; float: left;">
                    &nbsp;<a title="点击链接公司官网" href="javascript:void()">技术支持：上海力软信息科技有限公司</a>
                    <span class="south-separator"></span>
                    &nbsp;专业版 V1.1
               
                    <span class="south-separator"></span>
                    &nbsp;<a title="将问题提交给开发商进行解决" target="_blank" href="http://mail.qq.com/cgi-bin/qm_share?t=qm_mailme&email=uICJioyLiYuPivjJyZbb19U">问题反馈</a>
                    <span class="south-separator"></span>
                </div>
                <div style="width: 16%; text-align: left; float: left;">
                    <a title=".NET快速信息化系统开发框架" href="javascript:void()">CopyRight © 2010-2013 By Learun</a>
                </div>
                <div style="width: 42%; text-align: right; float: left;">
                    <span class="south-separator"></span>
                    操作员：@ViewBag.UserName
                    <span class="south-separator"></span>
                    所在部门：@ViewBag.DepartmentName
                    &nbsp;
                </div>
            </div>
        </div>
        <!--载进度条start-->
        <div id="loading" onclick="Loading(false);">
            <img src="../Themes/Images/loading.gif" style="padding-bottom: 4px; vertical-align: middle;" />&nbsp;正在处理，请稍待&nbsp;
        </div>
        <div id="Toploading">
        </div>
        <!--载进度条end-->
    </form>
</body>
</html>
